package com.fanrenqiji.entity;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by yanwt on 2017/3/20.
 */
@Getter
@Setter
@Entity
@Table(name="tb_feedback_detail")
@org.hibernate.annotations.Table(appliesTo = "tb_feedback_detail",comment = "问题反馈明细表")
@org.hibernate.annotations.DynamicInsert
@org.hibernate.annotations.DynamicUpdate
@org.hibernate.annotations.Cache(region="feedback_detail", usage = CacheConcurrencyStrategy.READ_WRITE)
public class FeedbackDetailEntity extends DataEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ManyToOne
    @JoinColumn(name="feedback_id",columnDefinition=("bigint(20) default null comment '问题反馈ID'"))//,foreignKey = @ForeignKey(value=ConstraintMode.NO_CONSTRAINT))
    @Where(clause="del_flag="+DEL_FLAG_NORMAL)
    private FeedbackEntity feedback;

    @Column(columnDefinition="text default null comment '回复内容'")
    private String content;


    @ManyToOne
    @JoinColumn(name="reply_teacher_id",columnDefinition=("bigint(20) default null comment '回复老师ID'"))//,foreignKey = @ForeignKey(value=ConstraintMode.NO_CONSTRAINT))
    @Where(clause="del_flag="+DEL_FLAG_NORMAL)
    private TeacherEntity replyTeacher;

    @ManyToOne
    @JoinColumn(name = "parent_id", columnDefinition = ("bigint(20) default null comment '家长ID'"))//,foreignKey = @ForeignKey(value=ConstraintMode.NO_CONSTRAINT))
    @Where(clause = "del_flag=" + DEL_FLAG_NORMAL)
    private ParentEntity parent;
}
